package com.example.util;

//判断某年某月有多少天

public class PDDays {
    public static int dayMonth(int year,int month) {
        int day = 0;
        if(year%400==0 || (year%4==0 && year%100!=0)){
            switch (month){
                case 1,3,5,7,8,10,12: day = 31;break;
                case 4,6,9,11: day = 30;break;
                case 2: day = 29;break;
            }
        }else {
            switch (month){
                case 1,3,5,7,8,10,12: day = 31;break;
                case 4,6,9,11: day = 30;break;
                case 2: day = 28;break;
            }
        }
        return day;
    }
}
